﻿using System;
using System.Collections.Generic;
using System.Text;
using WeMakeSP.Platform.SharePoint.ExceptionHandling;

namespace WeMakeSP.WebComponents.RSSAdvancedReaderWebPart
{
    /// <summary>
    /// The delegate for the feed refresh event.
    /// <param name="sender">The sender.</param>
    /// <param name="e">The feed refresh event arguments.</param>
    /// </summary>
    public delegate void FeedRefresh(object sender, FeedRefreshEventArgs e);

    /// <summary>
    /// The delegate for the feed item refresh event.
    /// <param name="sender">The sender.</param>
    /// <param name="e">The feed item refresh event arguments.</param>
    /// </summary>
    public delegate void FeedItemRefresh(object sender, FeedItemRefreshEventArgs e);

    /// <summary>
    /// The interface for the RSS advanced reader view.
    /// </summary>
    public interface IRSSAdvancedReaderView : IErrorVisualizer
    {
        #region Events

        /// <summary>
        /// Occurs when [feed item body displaying].
        /// </summary>
        event FeedItemRefresh FeedItemBodyDisplaying;

        /// <summary>
        /// Occurs when [feed refreshing].
        /// </summary>
        event FeedRefresh FeedRefreshing;

        /// <summary>
        /// Occurs when [feed showing all].
        /// </summary>
        event FeedRefresh FeedShowingAll;

        /// <summary>
        /// Occurs when [load].
        /// </summary>
        event EventHandler Load;

        /// <summary>
        /// Occurs when [pre render].
        /// </summary>
        event EventHandler PreRender;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets a value indicating whether [asynchronous load].
        /// </summary>
        /// <value><c>True</c> if [asynchronous load]; otherwise, <c>false</c>.</value>
        bool AsynchronousLoad
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the auto refresh interval.
        /// </summary>
        /// <value>The auto refresh interval.</value>
        int AutoRefreshInterval
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the data source.
        /// </summary>
        /// <value>The data source.</value>
        object DataSource
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the feeds.
        /// </summary>
        /// <value>The feeds.</value>
        string Feeds
        {
            get;
            set;
        }

        /// <summary>
        /// Gets a value indicating whether this instance is in async post back.
        /// </summary>
        /// <value>
        /// <c>True</c> if this instance is in async post back; otherwise, <c>false</c>.
        /// </value>
        bool IsInAsyncPostBack
        {
            get;
        }

        /// <summary>
        /// Gets a value indicating whether this instance is post back.
        /// </summary>
        /// <value>
        /// <c>True</c> if this instance is post back; otherwise, <c>false</c>.
        /// </value>
        bool IsPostBack
        {
            get;
        }

        /// <summary>
        /// Gets or sets the item view.
        /// </summary>
        /// <value>The item view.</value>
        RSSAdvancedReaderItemView ItemView
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the limit.
        /// </summary>
        /// <value>The limit.</value>
        int Limit
        {
            get;
            set;
        }       

        /// <summary>
        /// Gets or sets the orientation.
        /// </summary>
        /// <value>The orientation.</value>
        RSSAdvancedReaderOrientation Orientation
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether [show feed image].
        /// </summary>
        /// <value><c>True</c> if [show feed image]; otherwise, <c>false</c>.</value>
        bool ShowFeedImage
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value indicating whether [show publication date].
        /// </summary>
        /// <value><c>true</c> if [show publication date]; otherwise, <c>false</c>.</value>
        bool ShowPublicationDate
        {
            get;
            set;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Datas the bind.
        /// </summary>
        void DataBind();

        #endregion
    }
}
